package com.sjgs.gis.service.dto;

import java.io.Serializable;
import java.util.Objects;

import com.sjgs.gis.web.rest.JdbcClusterResource;
import io.github.jhipster.service.Criteria;
import io.github.jhipster.service.filter.Filter;
import io.github.jhipster.service.filter.IntegerFilter;
import io.github.jhipster.service.filter.LongFilter;
import io.github.jhipster.service.filter.StringFilter;

/**
 * Criteria class for the {@link com.sjgs.gis.domain.JdbcCluster} entity. This class is used
 * in {@link JdbcClusterResource} to receive all the possible filtering options from
 * the Http GET request parameters.
 * For example the following could be a valid request:
 * {@code /jdbc-clusters?id.greaterThan=5&attr1.contains=something&attr2.specified=false}
 * As Spring is unable to properly convert the types, unless specific {@link Filter} class are used, we need to use
 * fix type specific filters.
 */
public class JdbcClusterCriteria implements Serializable, Criteria {

    private static final long serialVersionUID = 1L;

    private LongFilter id;

    private StringFilter name;

    private StringFilter version;

    private StringFilter driver;

    private StringFilter host;

    private IntegerFilter port;

    private StringFilter username;

    private StringFilter password;

    private StringFilter database;

    private StringFilter config;

    private LongFilter nodeId;

    public JdbcClusterCriteria() {
    }

    public JdbcClusterCriteria(JdbcClusterCriteria other) {
        this.id = other.id == null ? null : other.id.copy();
        this.name = other.name == null ? null : other.name.copy();
        this.version = other.version == null ? null : other.version.copy();
        this.driver = other.driver == null ? null : other.driver.copy();
        this.host = other.host == null ? null : other.host.copy();
        this.port = other.port == null ? null : other.port.copy();
        this.username = other.username == null ? null : other.username.copy();
        this.password = other.password == null ? null : other.password.copy();
        this.database = other.database == null ? null : other.database.copy();
        this.config = other.config == null ? null : other.config.copy();
        this.nodeId = other.nodeId == null ? null : other.nodeId.copy();
    }

    @Override
    public JdbcClusterCriteria copy() {
        return new JdbcClusterCriteria(this);
    }

    public LongFilter getId() {
        return id;
    }

    public void setId(LongFilter id) {
        this.id = id;
    }

    public StringFilter getName() {
        return name;
    }

    public void setName(StringFilter name) {
        this.name = name;
    }

    public StringFilter getVersion() {
        return version;
    }

    public void setVersion(StringFilter version) {
        this.version = version;
    }

    public StringFilter getDriver() {
        return driver;
    }

    public void setDriver(StringFilter driver) {
        this.driver = driver;
    }

    public StringFilter getHost() {
        return host;
    }

    public void setHost(StringFilter host) {
        this.host = host;
    }

    public IntegerFilter getPort() {
        return port;
    }

    public void setPort(IntegerFilter port) {
        this.port = port;
    }

    public StringFilter getUsername() {
        return username;
    }

    public void setUsername(StringFilter username) {
        this.username = username;
    }

    public StringFilter getPassword() {
        return password;
    }

    public void setPassword(StringFilter password) {
        this.password = password;
    }

    public StringFilter getDatabase() {
        return database;
    }

    public void setDatabase(StringFilter database) {
        this.database = database;
    }

    public StringFilter getConfig() {
        return config;
    }

    public void setConfig(StringFilter config) {
        this.config = config;
    }

    public LongFilter getNodeId() {
        return nodeId;
    }

    public void setNodeId(LongFilter nodeId) {
        this.nodeId = nodeId;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        final JdbcClusterCriteria that = (JdbcClusterCriteria) o;
        return
            Objects.equals(id, that.id) &&
            Objects.equals(name, that.name) &&
            Objects.equals(version, that.version) &&
            Objects.equals(driver, that.driver) &&
            Objects.equals(host, that.host) &&
            Objects.equals(port, that.port) &&
            Objects.equals(username, that.username) &&
            Objects.equals(password, that.password) &&
            Objects.equals(database, that.database) &&
            Objects.equals(config, that.config) &&
            Objects.equals(nodeId, that.nodeId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(
        id,
        name,
        version,
        driver,
        host,
        port,
        username,
        password,
        database,
        config,
        nodeId
        );
    }

    // prettier-ignore
    @Override
    public String toString() {
        return "JdbcClusterCriteria{" +
                (id != null ? "id=" + id + ", " : "") +
                (name != null ? "name=" + name + ", " : "") +
                (version != null ? "version=" + version + ", " : "") +
                (driver != null ? "driver=" + driver + ", " : "") +
                (host != null ? "host=" + host + ", " : "") +
                (port != null ? "port=" + port + ", " : "") +
                (username != null ? "username=" + username + ", " : "") +
                (password != null ? "password=" + password + ", " : "") +
                (database != null ? "database=" + database + ", " : "") +
                (config != null ? "config=" + config + ", " : "") +
                (nodeId != null ? "nodeId=" + nodeId + ", " : "") +
            "}";
    }

}
